feat(network): support hotplug/hotunplug of additional network interfaces#2187
Draft
feat(network): support hotplug/hotunplug of additional network interfaces#2187
Conversation
Contributor
|
Workflow has started. The target step completed with status: failure. |
Signed-off-by: Daniil Loktev <70405899+loktev-d@users.noreply.github.com>
Contributor
|
Workflow has started. The target step completed with status: failure. |
Contributor
|
Workflow has started. The target step completed with status: failure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for hotplugging and hotunplugging additional network interfaces (
Network,ClusterNetwork) on running VMs without restart.Changes
Comparator (
pkg/controller/vmchange/comparator_pod_placement.go)compareNetworksnow classifies non-Main network add/remove asActionApplyImmediateinstead ofActionRestart. Main network changes still require restart. New helperisOnlyNonMainNetworksChangedtreats nil/emptyspec.networksas equivalent to having an implicit default Main, so thenil → [Main, additional]transition is also non-disruptive.Apply path (
pkg/controller/vm/internal/sync_kvvm.go)ActionApplyImmediatechanges that touch networks, the controller now:network.deckhouse.io/networks-specannotation directly so the SDN module creates/removes the tap before KubeVirt tries to attach it (KVVM template annotation changes don't propagate to a running pod).network.deckhouse.io/networks-status(uses pod watcher to retrigger reconcile) — without this, virt-launcher panics with "Link not found" when libvirt tries to attach a tap that doesn't exist yet.KVVM builder (
pkg/controller/kvbuilder/kvvm.go,kvvm_utils.go)SetNetworkInterfaceAbsentmethod setsState: virtv1.InterfaceStateAbsenton an interface to signal hotunplug to KubeVirt.Why do we need it, and what problem does it solve?
Currently, adding or removing additional networks on a VM requires a full restart, which is disruptive for production workloads. With this PR users can attach/detach
Network/ClusterNetworkinterfaces on running VMs and the changes take effect in the guest OS without reboot.What is the expected result?
Running.spec.networksto add aClusterNetwork. The VM'sNeedRestartfield stays clear; the new interface appears in the guest OS within seconds.spec.networksto remove theClusterNetwork. The interface disappears from the guest OS without a restart.AwaitingRestartToApplyConfigurationcondition is set).Checklist
Changelog entries